using System;
using System.Collections.Generic;
using System.Text;
using Calc.Operations;

namespace Calc.Execution
{
	public enum ExecutionType
	{
		/// <summary>
		/// Empty statement
		/// </summary>
		None,

		/// <summary>
		/// The statement was evaluated and a double result was returned
		/// </summary>
		Eval,

		/// <summary>
		/// A function was assigned a value
		/// </summary>
		FunctionAssignment,

		/// <summary>
		/// A variable was assigned a value
		/// </summary>
		VariableAssignment,

		/// <summary>
		/// An error occured
		/// </summary>
		Error,
	}

	public class ExecutionResult
	{
		protected string _statement;
		protected string _message;
		protected ExecutionType _result;
		protected double _value;

		public ExecutionResult(string statement, string message, double value)
			: this(statement, message, ExecutionType.Eval, 0.0d)
		{
		}

		public ExecutionResult(string statement, string message, ExecutionType result, double value)
		{
			_statement = statement;
			_message = message;
			_result = result;
			_value = value;
		}

		public string Statement
		{
			get { return _statement; }
		}

		public string Message
		{
			get { return _message; }
		}

		public ExecutionType Result
		{
			get { return _result; }
		}

		public double Value
		{
			get { return _value; }
		}
	}
}
